import socket

__author__ = 'lirui'

import requests
import logging
import ssl
import functools


old_init = ssl.SSLSocket.__init__


@functools.wraps(old_init)
def fix_ssl_version_init(self, *arg, **kwargs):
    kwargs['ssl_version'] = ssl.PROTOCOL_TLSv1
    old_init(self, *arg, **kwargs)


ssl.SSLSocket.__init__ = fix_ssl_version_init

session = requests.session()
r = session.get("https://pentesterlab.com:443/exercises")

print r.text
